tab = readtable('row_share2.csv');
tab = table2array(tab);

tab1 = readtable('uk_graph2-1_resid2.csv');
tab1 = table2array(tab1);

% FigB2

figure()
plot(tab(:,1), -1./tab(:,2),'LineWidth',1.5);
xlim([1940 2020]);
legend('Elasticity');
xlabel('Date');

% FigB3

figure('position', [0, 0, 800, 300])

subplot(1,2,1)

yyaxis right
plot(tab1(:,1), tab1(:,10),'LineWidth',1.2);
% ylim([0.1, 1.1]);

yyaxis left
plot(tab(:,1), tab(:,3),'LineWidth',1.2);
% ylim([-0.03, 0.06]);

xlim([1940 2020]);
legend('Foreign investor share (left)', 'Debt-to-GDP (right)');
xlabel('Date');
title('a) Debt and Foreign investor share');

ax = gca;
ax.YAxis(1).Color = 'k';
ax.YAxis(2).Color = 'k';

subplot(1,2,2)

yyaxis right
plot(tab1(:,1), tab1(:,5),'LineWidth',1.2);
% ylim([0.1, 1.1]);

yyaxis left
plot(tab(:,1), tab(:,3),'LineWidth',1.2);
% ylim([-0.03, 0.06]);

xlim([1940 2020]);
legend('Foreign investor share (left)', 'Spread (right)');
xlabel('Date');
title('b) Spread and Foreign investor share');

ax = gca;
ax.YAxis(1).Color = 'k';
ax.YAxis(2).Color = 'k';

